package cn.stylefeng.guns.modular.business.frequency.financecheck.mapper;

import cn.stylefeng.guns.modular.business.frequency.finance.model.param.FinanceDTO;
import cn.stylefeng.guns.modular.business.frequency.finance.model.result.PkgFinanceCheck;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.stylefeng.guns.modular.business.frequency.financecheck.entity.FinanceCheck;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 对账单结算记录表 Mapper 接口
 *
 * @author yujie
 * @date 2023/05/09 17:17
 */
public interface FinanceCheckMapper extends BaseMapper<FinanceCheck> {

    String getSettlementIdByTransportNo(@Param("transportNo") String transportNo);

    List<PkgFinanceCheck> getPkgFinanceCheckListById(@Param("id") String id,@Param("tenantId")Long tenantId);

    Page<FinanceCheck> getFinanceCheckListPage(@Param("page") Page<Object> defaultPage, @Param("financeDTO") FinanceDTO financeDTO,@Param("tenantId")Long tenantId);

    FinanceCheck getFinanceCheckSummary(@Param("financeDTO") FinanceDTO financeDTO, @Param("tenantId") Long tenantId);

    @Update("update tt_finance_check set status = #{status} where id = #{id}")
    void updateStatusById(@Param("id") Long id, @Param("status") Integer status);
}